package rs.pnv.config;

import javax.xml.ws.Endpoint;

import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;

import rs.pnv.pcc.PccImpl;

@Configuration
@ImportResource("classpath:META-INF/cxf/cxf.xml")
public class SepCxfConfiguration {

	@Autowired
	private Bus cxfBus;

	@Bean
	public Endpoint pcc() {
		EndpointImpl endpoint = new EndpointImpl(cxfBus, new PccImpl());
		endpoint.setAddress("/PCC");
		endpoint.publish();
		return endpoint;
	}

}
